<?php

/**
 * Class simulate Or operator
 *
 * @author Bui Tien Hiep
 * @Email bthiep@lhv.vn
 */
class AndSpecification implements ISpecification {
    protected $spec;
    protected $andSpec;
    
    public function __construct(Specification $spec,Specification $orSpec) {
        $this->spec =$spec;
        $this->andSpec = $orSpec;
    }
public function isSatistifiedBy($expenses) {
        return ($this->spec->isSatistifiedBy($expenses) ||   $this->andSpec->isSatistifiedBy($expenses));
    }
}
